package com.ld.security.cloud.nacos;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件服务
 */
@FeignClient(name="ld-tool")
@RequestMapping("/upload")
public interface FileFeign {

    @RequestMapping(value="/rpc/pub",method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String uploadFile(@RequestPart("file") MultipartFile multipartFile);

    @RequestMapping(value="/ossDownloadFile",method = RequestMethod.GET)
    byte[] ossDownloadFile(@RequestParam("id") String id);

}
